package leetcode.leetcode326;

/**
 * @author czt
 * @version 1.0
 * @since 2024/12/27
 */
public class Leetcode326 {

    public boolean isPowerOfThree(int n) {
        if (n <= 0) {
            return false;
        }
        while (n % 3 == 0) {
            n /= 3;
        }
        return n == 1;
    }

}
